package com.esri.core.symbol;

import com.esri.core.internal.util.d;
import java.io.StringWriter;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;

/* loaded from: classes.dex */
public class SimpleFillSymbol extends FillSymbol {
    public static final String TYPE = "esriSFS";
    private static final String c = "type";
    private static final String d = "style";
    private static final long serialVersionUID = 1;
    private STYLE e;

    /* loaded from: classes.dex */
    public enum STYLE {
        NULL("esriSFSNull"),
        SOLID("esriSFSSolid"),
        HORIZONTAL("esriSFSHorizontal"),
        VERTICAL("esriSFSVertical"),
        FORWARD_DIAGONAL("esriSFSForwardDiagonal"),
        BACKWARD_DIAGONAL("esriSFSBackwardDiagonal"),
        CROSS("esriSFSCross"),
        DIAGONAL_CROSS("esriSFSDiagonalCross");
        
        private String a;

        STYLE(String str) {
            this.a = str;
        }

        public String getValue() {
            return this.a;
        }

        public static STYLE fromString(String str) {
            STYLE[] values;
            for (STYLE style : values()) {
                if (style.getValue().equals(str)) {
                    return style;
                }
            }
            return null;
        }

        @Override // java.lang.Enum
        public String toString() {
            return this.a;
        }
    }

    public SimpleFillSymbol(JsonNode jsonNode) throws Exception {
        super(jsonNode);
        this.e = STYLE.SOLID;
        setStyle(STYLE.fromString(d.a(jsonNode, d)));
    }

    public SimpleFillSymbol(int i) {
        this(i, STYLE.SOLID);
    }

    public SimpleFillSymbol(int i, STYLE style) {
        this.e = STYLE.SOLID;
        setColor(i);
        setStyle(style);
    }

    public SimpleFillSymbol(SimpleFillSymbol simpleFillSymbol) throws Exception {
        this(simpleFillSymbol.getColor(), simpleFillSymbol.getStyle());
        if (simpleFillSymbol.b != null) {
            this.b = (LineSymbol) simpleFillSymbol.getOutline().copy();
        } else {
            this.b = null;
        }
    }

    public SimpleFillSymbol setStyle(STYLE style) {
        this.e = style;
        return this;
    }

    public STYLE getStyle() {
        return this.e;
    }

    @Override // com.esri.core.symbol.Symbol
    public String toJson() throws Exception {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator a = d.a(stringWriter);
        a.writeStartObject();
        d.a(a, c, TYPE);
        d.a(a, d, this.e.getValue());
        super.a(a);
        a.writeEndObject();
        a.close();
        return stringWriter.toString();
    }

    @Override // com.esri.core.symbol.FillSymbol
    public int hashCode() {
        int hashCode = super.hashCode() * 31;
        STYLE style = this.e;
        return hashCode + (style == null ? 0 : style.hashCode());
    }

    @Override // com.esri.core.symbol.FillSymbol
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        return super.equals(obj) && getClass() == obj.getClass() && this.e == ((SimpleFillSymbol) obj).e;
    }

    @Override // com.esri.core.symbol.Symbol
    public Symbol copy() throws Exception {
        SimpleFillSymbol simpleFillSymbol = new SimpleFillSymbol(this.a, this.e);
        simpleFillSymbol.b = (LineSymbol) this.b.copy();
        return simpleFillSymbol;
    }
}
